import storage from "@/utils/storage/index.js";
import config from "@/config/config";
let xinImg = "https://www.topyunliu.com/imgs/vip/xin.png";
let ai2030Img = "https://www.topyunliu.com/imgs/vip/ai2030.png";
import ai2030ShareImg from "/static/imgs/invite/1.png";
import xinShareImg from "/static/imgs/invite/2.png";

export function getSiteCodeBySitDomain(siteDomain) {
  let code = "xin";
  if (siteDomain.includes("20ai30")) {
    code = "ai2030";
  } else if (siteDomain.includes("jy")) {
    code = "jy";
  } else if (siteDomain.includes("AI小精灵")) {
    code = "oy";
  } else if (siteDomain.includes("topyunliu")) {
    code = "xin";
  }
  return code;
}
let basic = {
  // 默认配置
  home: {
    functionList: {
      // 首页的功能列表

      custom: false, // 是否显示自定义功能
    },
  },
  pay: {
    // 支付模块
    isBindPhone: true, // 支付是否需要绑定手机号
  },
};
let projects = {
  xin: {
    name: "xin",
    home: {
      // 首页的功能列表
      functionList: {
        custom: true,
      },
    },
    followGzhUrl:
      "https://devweb.topyunliu.com/upload/2024/01/04/file_20240104175321A028.jpeg",
    agent: (level) => [5, 6].includes(level),
    // 支付模块
    pay: {
      isBindPhone: true, // 支付是否需要绑定手机号
    },
    painting: {
      tipsAlert: true,
      banner: [
        {
          path: [
            "https://www.topyunliu.com/upload/2024/05/16/file_20240516150903A003.png",
          ],
          toPage: "",
        },
        {
          path: [
            "https://www.topyunliu.com/upload/2024/05/16/file_20240516150934A004.png",
          ],
          toPage: "",
        },
      ],
    },
    my: {
      corpId: "ww1e59be6037b37ae9", // 企业id
    },
    chat: {
      chatVipShow: {
        key: "level",
      },
      contactImgPath: "https://www.topyunliu.com/imgs/vip/xin.png", // 联系客服卡片图片地址
    },
    share: {
      imgPath: xinShareImg,
    },
  },
  ai2030: {
    name: "ai2030",
    followGzhUrl:
      "https://www.20ai30.com/upload/2024/01/25/file_20240125171556A007.png",
    agent: (level) => [5, 6].includes(level),
    pay: {
      isBindPhone: false, // 支付是否需要绑定手机号
    },
    painting: {
      tipsAlert: false,
      banner: [
        {
          path: [
            "https://www.20ai30.com/upload/2024/05/16/file_20240516151118A001.png",
          ],
          toPage: "https://mp.weixin.qq.com/s/e2lHgurj5U7NaYFb8b2fsw",
        },
      ],
    },
    my: {
      corpId: "wwee4e06f9a007b96b",
    },
    chat: {
      chatVipShow: { key: "level", key: "freeCount" },

      contactImgPath: ai2030Img, // 联系客服卡片图片地址
    },
    share: {
      imgPath: ai2030ShareImg,
    },
  },
  oy: {
    pay: {
      // 支付模块
      isBindPhone: false, // 支付是否需要绑定手机号
    },
    painting: {
      tipsAlert: false,
    },
    my: {
      corpId: "",
    },
  },
};
let siteCode = getSiteCodeBySitDomain(config.siteDomain);
// siteCode = storage.get("siteInfo").siteCode;
let projectConfig = Object.assign({}, basic, projects[siteCode || "xin"]);
export default projectConfig;
